package dao.impl;

import dao.TeacherDao;
import mapper.StudentMapper;
import mapper.TeacherMapper;
import org.apache.ibatis.session.SqlSession;
import pojo.Student;
import pojo.Teacher;
import util.MybatisUtil;

public class TeacherDaoImpl implements TeacherDao {
    private static SqlSession session=null;
    @Override
    public Teacher login(String username) {
        Student student=null;
        Teacher teacher=null;
        try {
            session = MybatisUtil.createSqlSession();
            teacher = session.getMapper(TeacherMapper.class).login(username);
            return teacher;
        }finally {
            session.close();
        }
    }
}
